import 'package:kongqi/http/manager.dart';

Future getKongQiList(String sort) async {
  String url = "/weather/air/sort?sort=$sort";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getKongQiDetail(String id) async {
  String url = "/weather/air/detail?id=$id";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getCitySearch(String city) async {
  String url = "/weather/air/search?city=$city";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getPM25List() async {
  String url = "/weather/air/pm25List";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getPM25Detail(String id) async {
  String url = "/weather/air/pm25Detail?id=$id";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}
